home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / BSD #includes / (include) / vm⁄faultcode.h < prev   
Encoding:
Text File  |  1992-07-27  |  1023 b   |  34 lines  |  [TEXT/UNIX]

  1. /*    @(#)faultcode.h    1.4 89/07/26 SMI    */
  2.  
  3. /*
  4.  * Copyright (c) 1987 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef _vm_faultcode_h
  8. #define    _vm_faultcode_h
  9.  
  10. /*
  11.  * This file describes the "code" that is delivered during
  12.  * SIGBUS and SIGSEGV exceptions.  It also describes the data
  13.  * type returned by vm routines which handle faults.
  14.  *
  15.  * If FC_CODE(fc) == FC_OBJERR, then FC_ERRNO(fc) contains the errno value
  16.  * returned by the underlying object mapped at the fault address.
  17.  */
  18. #define    FC_HWERR    0x1    /* misc hardware error (e.g. bus timeout) */
  19. #define    FC_ALIGN    0x2    /* hardware alignment error */
  20. #define    FC_NOMAP    0x3    /* no mapping at the fault address */
  21. #define    FC_PROT        0x4    /* access exceeded current protections */
  22. #define    FC_OBJERR    0x5    /* underlying object returned errno value */
  23.  
  24. #define    FC_MAKE_ERR(e)    (((e) << 8) | FC_OBJERR)
  25.  
  26. #define    FC_CODE(fc)    ((fc) & 0xff)
  27. #define    FC_ERRNO(fc)    ((unsigned)(fc) >> 8)
  28.  
  29. #ifndef LOCORE
  30. typedef    int    faultcode_t;    /* type returned by vm fault routines */
  31. #endif 
  32.  
  33. #endif /*!_vm_faultcode_h*/
  34.